

<style>
  .guide_download{
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 999;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0,0,0,.5);
  }
  
  .download_close{
    width: 0.7rem;
    height: 0.7rem;
    background: url('__PUBLIC__/images/public/v1/guanbi@2x.png') no-repeat;
    background-size: 100% 100%;
    margin-bottom: .2rem;
    margin-left: auto;
    margin-right: 0.5rem;
  }
  
  .download_img{
    width: 6.9rem;
    height: 7.86rem;
    background: url('__PUBLIC__/images/public/v1/img.png') no-repeat;
    background-size: 100% 100%;
  }
  </style>
  
  <div class="guide_download">
    <div class="download_close"></div>
    <div class="download_img"></div>
  </div>
  
  <script>
  
  var isAndroid = /Android|Adr/i.test(window.navigator.userAgent.toLowerCase())
  var isios = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(window.navigator.userAgent.toLowerCase())
  var iswx = /MicroMessenger/i.test(window.navigator.userAgent.toLowerCase())
  
  var handleCloseCtrl = false
  
  // 安卓环境下，在此名单里的就弹
  var showList = [
  // MQQBrowser AndroidQQ浏览器
  // UC UCWEB
  // 腾讯浏览器 TencentTraveler QQBrowser
  'MicroMessenger',
  'MQQBrowser',
  'TencentTraveler',
  'QQBrowser',
  'UCWEB',
  'ucbrowser',
  
  
  'liebaofast',//猎豹浏览器
  // 'ecalendar', //万年历
  // 'faster', //一个浏览器
  'haowangzhi',//
  '99browser',//
  'minibrowser',//
  'mb2345browser',//
  'alitephone',// 360极速浏览器
  'privatebrowser',//
  'opr',//
  'firefox',//
  'sogoumse',//
  'sogoumobilebrowser',//
  // '',//
  // '',//
  // '',//
  // '',//
  // '',//
  // '',//
  // '',//
  // '',//
  ]
  var UASHOW = false
  showList.forEach(function(val){
    var reg = new RegExp(val,'i')
    if(reg.test(navigator.userAgent)){
      UASHOW = true
    }
  })
  
  console.log(UASHOW)
  isios && $('.guide_download').hide()
  !UASHOW && $('.guide_download').hide()
  !isios && !UASHOW && console.log('安卓不弹')
  !isios && UASHOW && console.log('安卓弹')
  
  $(window).on('scroll',function(e){
    if(isios && e.target.documentElement.scrollTop>1200 && !handleCloseCtrl){
      console.log('ios弹')
      if($('.guide_download').css('display')==='none'){
        $('.guide_download').show()
      }
    }
  })
  function total(str,url){
    $.getJSON("<!--{:U('Index/JGiosWxUrlClick','',false)}-->",{field:str},function(data){
      location.href  = url
    });
    
  // 参数：field（
  // 'ios_wx_url_click'    ios微信内
  // 'ios_wx_url_click_no'    ios微信外
  // 'and_wx_url_click'      安卓微信内
  // 'and_wx_url_click_no'  安卓微信外
  // ）
  }
  
  
  
  
  
  
  $('.download_close').click(function(){
    handleCloseCtrl = true
    $('.guide_download').hide()
  })
  $('.download_img').click(function(){
    if(isios){
      if(iswx){
        
        total('ios_wx_url_click','http://a.app.qq.com/o/simple.jsp?pkgname=com.mrkj.sm')
      }else{
        total('ios_wx_url_click_no','https://apps.apple.com/cn/app/id544144271')
  
      }
    }else{
      if(iswx){
        total('and_wx_url_click','http://a.app.qq.com/o/simple.jsp?pkgname=com.mrkj.sm')
        
      }else{
        total('and_wx_url_click_no','https://qiniu.ddznzj.com/media/190929/%E7%9F%A5%E5%91%BD%28%E9%A2%86%E5%8F%96%E6%AF%8F%E6%97%A5%E8%BF%90%E5%8A%BF%29.apk')
        
      }
    }
  })
  
  </script>
  